<template>
    <div>
        商品页
        <button @click="handleClick">返回上一页</button>
        <div class="box">
            <div class="left">
                <RouterLink to="/goods/list">商品列表</RouterLink><br>
                <RouterLink to="/goods/type">商品类型</RouterLink><br>
                <RouterLink to="/goods/add">商品添加</RouterLink><br>
            </div>
            <!-- 二级路由出口 -->
            <RouterView class="right"></RouterView>
        </div>

    </div>
</template>
<script setup>
import { useRouter, useRoute, RouterView, RouterLink } from 'vue-router'

//实例对象
const router = useRouter()
//信息对象
const route = useRoute()
console.log(route);


const handleClick = () => {
    //返回上一页
    // router.back()
    router.go(-1);
}
</script>
<style scoped>
.box {
    display: flex;

    .left {
        flex: 0 0 100px;
        height: 90vh;
    }

    .right {
        flex: 1;
        height: 90vh;
    }
}
</style>